<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:o="http://openfaces.org/">

    <head>
    </head>
    
    <body>
        <ui:composition template="/templates/default.xhtml">
		 	<ui:define name="title">OpenHDS - Create Demographic Rates</ui:define>
		
			<ui:param name="crud" value="#{demRatesCrud}" />
        
            <ui:define name="listing">
                <ui:include src="list.xhtml" />
            </ui:define>
            <ui:define name="display">
            
            	<h:outputText value="#{navController.breadcrumbTrail}" />
            
                <h1>#{msg.demRatesCreate}</h1>
                <h:messages id="errors" globalOnly="true" />
                <h:form id="form">   
                	  <h:panelGrid columns="3">
                	  
              		  		<h:outputText value="#{msg.demRatesStartDate} (#{siteProperties.dateFormat}):" />
              				<o:dateChooser id="startDate" value="#{demRatesCrud.startDate}" pattern="#{siteProperties.dateFormat}" />
              				<h:message for="startDate" errorClass="error" errorStyle="color: red" infoStyle="color: green" />
              			               				
              				<h:outputText value="#{msg.demRatesEndDate} (#{siteProperties.dateFormat}):" />
              				<o:dateChooser id="endDate" value="#{demRatesCrud.endDate}" pattern="#{siteProperties.dateFormat}" />
              				<h:message for="endDate" errorClass="error" errorStyle="color: red" infoStyle="color: green" />
              			               				
              				<h:outputText value="#{msg.demRatesEvent}:" />             				 				
              				<o:selectOneRadio id="radioList" value="#{demRatesCrud.item.event}" >
								<f:selectItem itemValue="#{msg.demRatesFertility}" itemLabel="#{msg.demRatesFertility}"/>
							  	<f:selectItem itemValue="#{msg.demRatesMortality}" itemLabel="#{msg.demRatesMortality}"/>
							  	<f:selectItem itemValue="#{msg.demRatesOutMigration}" itemLabel="#{msg.demRatesOutMigration}"/>
							  	<f:selectItem itemValue="#{msg.demRatesInMigration}" itemLabel="#{msg.demRatesInMigration}"/>
							  	<f:selectItem itemValue="#{msg.demRatesPopulation}" itemLabel="#{msg.demRatesPopulation}"/>
							</o:selectOneRadio>
							<h:message for="radioList" errorClass="error" errorStyle="color: red" infoStyle="color: green" />
						
              				<h:outputText value="#{msg.demRatesDenominator}:" />
              				<o:selectOneRadio id="denomList" value="#{demRatesCrud.item.denominator}" >
              					<f:selectItem itemValue="#{msg.demRatesMidpoint}" itemLabel="#{msg.demRatesMidpoint}"/>
								<f:selectItem itemValue="#{msg.demRatesPersonDaysObserved}" itemLabel="#{msg.demRatesPersonDaysObserved}"/>
							</o:selectOneRadio>
              				<h:message for="denomList" errorClass="error" errorStyle="color: red" infoStyle="color: green" />
                	</h:panelGrid>	
                		
                	<h:commandButton action="#{demRatesCrud.edit}" value="#{msg.lblSave}">
                		  <f:setPropertyActionListener target="#{jsfService.itemId}" value="#{demRatesCrud.item.uuid}" />
                	</h:commandButton>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>